home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_bridgeamb.cog < prev    next >
Text File  |  1999-11-15  |  1KB  |  63 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_BridgeAmb.cog
  4. #
  5. # Produces random ambient bridge sounds when attatched to a bridge.
  6. # Based on code from TEO_Drops.cog by SXC.
  7. #
  8. # [TRM & SXC]
  9. #
  10. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message     startup
  16.     message     pulse
  17.     
  18.     thing       bridge
  19.         
  20.     sound       sndBridge0=tem_bridge_b.wav    local
  21.     sound       sndBridge1=tem_bridge_c.wav    local
  22.         
  23.     float       dropFreq        local
  24.     
  25.     flex        pulseTime=2.0
  26.     flex        vol=1.0
  27.     flex        minDist=-1
  28.     flex        maxDist=-1
  29.     
  30. end
  31.  
  32. # ========================================================================================
  33.  
  34. code
  35.  
  36. startup:
  37.  
  38.     SetPulse(pulseTime);
  39.     
  40.     return;
  41.     
  42. # ========================================================================================
  43.  
  44. pulse:
  45.     
  46.     dropFreq = Rand();
  47.  
  48.     if (dropFreq < 0.35)
  49.         {
  50.             PlaySoundThing(sndBridge0, bridge, vol, minDist, maxDist, 0x0);
  51.         }
  52.         
  53.     if ((dropFreq > 0.35) && (dropFreq < 0.75))
  54.         {
  55.             PlaySoundThing(sndBridge1, bridge, vol, minDist, maxDist, 0x0);
  56.         }
  57.         
  58.     return;
  59.     
  60. # ========================================================================================
  61.         
  62. end
  63.